<!DOCTYPE html>
<html>
<head>
    <title>业务支撑系统</title>
<#import "/common/common.js.ftl" as netCommon>
<@netCommon.commonStyle />
</head>
<body class="hold-transition skin-blue sidebar-mini <#if cookieMap?exists && "off" == cookieMap["xxljob_adminlte_settings"].value >sidebar-collapse</#if> ">
<div class="wrapper">
    <header class="main-header">
        <a href="${request.contextPath}/main" target="view_frame" class="logo">
            <span class="logo-mini"><b>XXL</b></span>
            <span class="logo-lg"><b>业务支撑系统</b></span>
        </a>
        <nav class="navbar navbar-static-top" role="navigation">
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"><span
                    class="sr-only">切换导航</span></a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li class="dropdown user user-menu">
                        <a href=";" id="logoutBtn" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                            <span class="hidden-xs">注销</span>
                        </a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img src="${request.contextPath}/static/adminlte/dist/user2-160x160.jpg" class="img-circle"
                         alt="User Image">
                </div>
                <div class="pull-left info">
                    <p>admin</p>
                    <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
                </div>
            </div>

            <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu" data-widget="tree">
            <li class="header">菜单</li>
        <@shiro.hasPermission name="jobinfo">
            <li class="active treeview">
                <a href="#">
                    <i class="fa fa-dashboard"></i> <span>任务管理</span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <@shiro.hasPermission name="arithmeticjobinfo">
                        <li class="active"><a href="${request.contextPath}/jobinfo/1" target="view_frame" onclick="loadIframe($(this))"><i
                                class="fa fa-circle-o"></i>
                            算法任务管理</a></li>
                    </@shiro.hasPermission>

                    <@shiro.hasPermission name="downjobinfo">
                        <li class="active"><a href="${request.contextPath}/jobinfo/2" target="view_frame" onclick="loadIframe($(this))"><i
                                class="fa fa-circle-o"></i>
                            下载任务管理</a></li>
                    </@shiro.hasPermission>
                    <li class="active"><a href="${request.contextPath}/jobinfo/2" target="view_frame" onclick="loadIframe($(this))"><i
                            class="fa fa-circle-o"></i>
                        下载任务管理11</a></li>
                </ul>
            </li>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="jobprocess">

            <li class="treeview">
                <a href="${request.contextPath}/jobprocess" target="view_frame" onclick="loadIframe($(this))" >
                    <i class="fa fa-files-o"></i>
                    <span>流程管理</span>
                    <span class="pull-right-container">
            </span>
                </a>
            </li>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="joblog">

            <li class="treeview">
                <a href="${request.contextPath}/joblog" target="view_frame" onclick="loadIframe($(this))" >
                    <i class="fa fa-files-o"></i>
                    <span>调度日志</span>
                    <span class="pull-right-container">
            </span>
                </a>
            </li>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="jobgroup">
            <li class="treeview">
                <a href="${request.contextPath}/jobgroup" target="view_frame" onclick="loadIframe($(this))">
                    <i class="fa fa-th"></i> <span>节点管理</span>
                    <span class="pull-right-container">
            </span>
                </a>
            </li>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="productmodel">

            <li class="treeview">
                <a href="${request.contextPath}/processmodel" target="view_frame" onclick="loadIframe($(this))">
                    <i class="fa fa-pie-chart"></i>
                    <span>算法模型</span>
                    <span class="pull-right-container">
            </span>
                </a>
            </li>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="product">

            <li class="treeview">
                <a href="${request.contextPath}/product" target="view_frame" onclick="loadIframe($(this))">
                    <i class="fa fa-laptop"></i>
                    <span>产品分类</span>
                    <span class="pull-right-container">
            </span>
                </a>
            </li>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="productinfofile">

            <li class="treeview">
                <a href="${request.contextPath}/productfileinfo" target="view_frame" onclick="loadIframe($(this))">
                    <i class="fa fa-edit"></i> <span>产品结果</span>
                    <span class="pull-right-container">
            </span>
                </a>
            </li>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="system">

            <li class=" treeview">
                <a href="#">
                    <i class="fa fa-dashboard"></i> <span>系统管理</span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i></span>
                </a>
                <ul class="treeview-menu">
                    <@shiro.hasPermission name="user">

                        <li class="active"><a href="${request.contextPath}/user" target="view_frame" onclick="loadIframe($(this))"><i
                                class="fa fa-circle-o"></i>
                            用户管理</a></li>
                    </@shiro.hasPermission>
                    <@shiro.hasPermission name="role">

                        <li class="active"><a href="${request.contextPath}/role" target="view_frame" onclick="loadIframe($(this))"><i
                                class="fa fa-circle-o"></i>
                            角色管理</a></li>
                    </@shiro.hasPermission>
                    <@shiro.hasPermission name="resource">

                        <li class="active"><a href="${request.contextPath}/resource" target="view_frame" onclick="loadIframe($(this))"><i
                                class="fa fa-circle-o"></i>
                            资源管理</a></li>
                    </@shiro.hasPermission>

                </ul>
            </li>
          </@shiro.hasPermission>
            <li class="active"><a href="${request.contextPath}/ftp" target="view_frame" onclick="loadIframe($(this))"><i
                    class="fa fa-circle-o"></i>
                FTP管理</a></li>
            <li class="active"><a href="${request.contextPath}/monitor" target="view_frame" onclick="loadIframe($(this))"><i
                    class="fa fa-circle-o"></i>
                监控管理</a></li>

        </ul>

        </section>
        <!-- /.sidebar -->
    </aside>
    <div class="content-wrapper">
        <iframe src="${request.contextPath}/main" frameborder="0" onload="changeFrameHeight()"
                id="view_frame" name="view_frame" width="100%" height="100%"></iframe>
    </div>
</div>
<@netCommon.commonScript />
<script>
    function changeFrameHeight() {
        var ifm = document.getElementById("view_frame");
        ifm.height = document.documentElement.clientHeight;

    }

    window.onresize = function () {
        changeFrameHeight();

    }
    function loadIframe(obj) {
        //获取url链接
        var url="${request.contextPath}"+obj.attr("href");
        var u = window.location.href;
        //因为每次获取的链接中都有之前的旧锚点，
        //所以需要把#之后的旧锚点去掉再来加新的锚点（即传入的url参数）
        var end = u.indexOf("#");
        var rurl = u.substring(0,end);
        //设置新的锚点
        window.location.href = rurl + "#" + url;
    }
    window.onhashchange = function() {
        //location.hash取到的是url链接中#(包括自己)后面的内容
        var hash = location.hash;
        //去掉#号，得到的就是我们要设置到iframe中src上的地址
        var url = hash.substring(1,hash.length);
        $("#view_frame").attr("src", url);
    }
    document.addEventListener('DOMContentLoaded', function () {
        var hash = location.hash;
        var url = hash.substring(1,hash.length);
        if(url==""){
            url="/main";
        }
        $("#view_frame").attr("src", url);
    }, false);
</script>


</body>
</html>
